package com.tanhua.app.controller;

import com.tanhua.app.interceptor.UserHolder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value = "/huanxin")
        public class HuanxinController {

            /**
             * 获取当前用户，在环信的id和密码
             */
            @GetMapping("/user")
            public ResponseEntity huanxinUser() {
                Map<String,String> map = new HashMap();
                map.put("username", UserHolder.getUser().getId().toString());
                map.put("password", "123456");
                return ResponseEntity.ok(map);
    }
}
